package com.robot.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.robot.dao.entity.Category;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface CategoryMapper extends BaseMapper<Category> {

    @Select("select * from category where category_name = #{categoryName} and company_code = #{companyCode}")
    Category queryByIdAndName(String companyCode,String categoryName);

    @Select("select * from category where company_code = #{companyCode} and is_delete != 2")
    List<Category> queryByEnterpriseId(String  companyCode);

    void create(Category category);
}
